<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="./static/vue/2.6.10/vue.js" type="text/javascript"></script>
    <title>Title</title>
</head>
<body>
    <div id="app-5">
        <P>{{message}}</P>
        <button @click="reverseMessage">反转消息</button>
    </div>

    <script type="text/javascript">
        let vm = new Vue({
            el: '#app-5',
            data: {
                message: 'Hello Vue.js!'
            },
            methods: {
                reverseMessage: function () {
                    this.message = this.message.split('').reverse().join('')
                }
            }
        });
    </script>
</body>
</html>